<%--
  Created by IntelliJ IDEA.
  User: 何雨川
  Date: 2021/10/18
  Time: 22:34
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>书籍列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- 引入 Bootstrap -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="../../css/menustyle.css">
</head>
<body>
<div class="container-fluid">
    <div class="row-fluid clearfix">
        <!-- 导航栏 -->
        <div id="sidebar">
            <header>
                <a href="#">后台管理</a>
            </header>
            <ul class="nav">
                <li>
                    <a href="${pageContext.request.contextPath}/admin/allReader">
                        读者管理
                    </a>
                </li>
                <li>
                    <a href="#">
                        出入库管理
                    </a>
                </li>
                <li>
                    <a href="#">
                        借阅管理
                    </a>
                </li>
                <li>
                    <a href="#">
                        分类管理
                    </a>
                </li>
            </ul>
        </div>

        <!-- 正文 -->
        <div id="content">
            <div class="container-fluid" style="margin-left: 250px">
                <!-- 网页内容 -->
                <div class="container">

                    <div class="row clearfix">
                        <div class="col-md-12 column">
                            <div class="page-header">
                                <h1>
                                    <small>所有书籍详情</small>
                                </h1>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-4 column">
                            <a class="btn btn-primary" href="${pageContext.request.contextPath}/Lend/allBook">显示全部</a>
                        </div>
                        <div class="col-md-4 column"></div>
                        <div class="col-md-4 column">
                            <form action="${pageContext.request.contextPath}/Lend/queryBookByName" method="post" style="float: right" class="form-inline">
                                <input type="text" name="queryBookName" class="form-control" placeholder="请输入您想要借阅或要归还的书籍名">
                                <input type="submit" value="查询" class="btn btn-primary">
                            </form>
                        </div>
                        <div class="col-md-4 column">
                            <a class="btn btn-primary" href="${pageContext.request.contextPath}/Lend/toRecord">显示借阅记录</a>
                        </div>
                    </div>

                    <div class="row clearfix">
                        <div class="col-md-12 column">
                            <table class="table table-hover table-striped">
                                <thead>
                                <tr>
                                    <th>读者ID</th>
                                    <th>书籍ID</th>
                                    <th>借还状态</th>
                                    <th>借书日期</th>
                                    <th>还书日期</th>
                                </tr>
                                </thead>

                                <tbody>
                                <c:forEach var="lendList" items="${requestScope.get('lendList')}">
                                    <tr>
                                        <td>${lendList.getReaderId()}</td>
                                        <td>${lendList.getBookId()}</td>
                                        <td>${lendList.getState()}</td>
                                        <td>${lendList.getLendDate()}</td>
                                        <td>${lendList.getRemandDate()}</td>
                                        <td>
                                            <a href="${pageContext.request.contextPath}/Lend/toReaderLend?bookid=${lendList.getBookId()}&readerid=${lendList.getReaderId()}" >删除</a> |
                                        </td>
                                    </tr>
                                    </tr>

                                </c:forEach>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>




